package com.hangkong.service.impl;

import com.hangkong.dao.FlightDao;
import com.hangkong.model.Flight;
import com.hangkong.service.FlightService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class FlightServiceImpl implements FlightService {

    @Resource
    private FlightDao flightDao;


    public Flight insert(String flightno, String deptcity, String arrcity, String flightdate) {
        return flightDao.insert(flightno,deptcity,arrcity,flightdate);
    }

    public Flight del(Integer id) {
        return flightDao.del(id);
    }

    public List<Flight> getAll() {
        return flightDao.getAll();
    }

    public Flight showone(Integer id) {
        return flightDao.showone(id);
    }

    public Flight findone(String deptcity, String arrcity, String flightdate) {
        return flightDao.findone(deptcity,arrcity,flightdate);
    }

    public Flight update(Integer id, String flightno, String deptcity, String arrcity) {
        return flightDao.update(id,flightno,deptcity,arrcity);
    }

    public String getMaxId() {
        return flightDao.getMaxId();
    }

    public Integer findmaxid() {
        return flightDao.findmaxid();
    }

    public Integer insertcabF(Integer maxid, String cabinnamef, String cabinpricef, String countf) {
        return flightDao.insertcabf(maxid,cabinnamef,cabinpricef,countf);
    }

    public Integer insertcabY(Integer maxid, String cabinnamey, String cabinpricey, String county) {
        return flightDao.insertcaby(maxid,cabinnamey,cabinpricey,county);
    }

    public Integer insertcabE(Integer maxid, String cabinnamee, String cabinpricee, String counte) {
        return flightDao.insertcabe(maxid,cabinnamee,cabinpricee,counte);
    }

    public Integer insertcabR(Integer maxid, String cabinnamer, String cabinpricer, String countr) {
        return flightDao.insertcabr(maxid,cabinnamer,cabinpricer,countr);
    }


}
